import { DataSource } from 'typeorm';
import { Mold } from '../entity/mold.entity';
import { Product } from '../entity/product.entity';
import { SysOss } from '../entity/oss.entity'

export const indexProviders = [
  {
    provide: 'MOLD_REPOSITORY',
    useFactory: (dataSource: DataSource) => dataSource.getRepository(Mold),
    inject: ['DATA_SOURCE'],
  },
  {
    provide: 'PRODUCT_REPOSITORY',
    useFactory: (dataSource: DataSource) => dataSource.getRepository(Product),
    inject: ['DATA_SOURCE'],
  },
  {
    provide: 'SYS_OSS_REPOSITORY',
    useFactory: (dataSource: DataSource) => dataSource.getRepository(SysOss),
    inject: ['DATA_SOURCE'],
  },
];